#ifndef _GRAPH_H_
#define _GRAPH_H_
#include <iostream>
#include <unordered_map>
#include <string>
#include <list>
#include <functional>
#include <stack>
#include <queue>
#include <vector>
#include "vertice.hpp"

using CallBack = function<std::string>;

class Graph
{
public:
    Graph()
    {
        _map = std::unordered_map<std::string, std::list<Connect>>();
    };
    ~Graph(){};
    Graph(const Graph &) = delete;
    Graph operator=(const Graph &) = delete;

    // bool addVertice(const Vertice &v);
    bool delVertice(const std::string &v);
    bool addVertice(const std::string &v);
    // bool delVertice(const Vertice &v);

    bool connectAtoB(const std::string &A, const std::string &B);
    // bool connectAtoB(const Vertice &A, const Vertice &B);
    bool connectAtoB(const std::string &A, const std::string &B, int len);
    // bool connectAtoB(const Vertice &A, const Vertice &B, int len);

    void BFS();
    void DFS();

    void BFS(CallBack &func);
    void DFS(CallBack &func);

    // private:
    std::unordered_map<std::string, std::list<Connect>> _map;
    std::unordered_map<string, bool> _alivemap;
};

#endif